#include <bits/stdc++.h>
using namespace std;

int main() {
    ios_base::sync_with_stdio(false);cin.tie(nullptr);
    set<string> dic;
    string in;
    while(cin >> in){
        dic.insert(in);
    }
    for(auto j:dic){
        for (auto i= j.begin() + 1;  i!= j.end(); ++i) {
            string s1(j.begin(), i), s2(i, j.end());
            if(dic.count(s1) && dic.count(s2)){
                cout << j << "\n";
                break;
            }
        }
    }

    return 0;
}